<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no"><meta name="renderer" content="webkit">
    <META HTTP-EQUIV="pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <META HTTP-EQUIV="expires" CONTENT="0">
    <title>评选系统 后台登录</title>
    <link href="htStatic/css/bootstrap.min-3.4.0.css" rel="stylesheet">
    <link href="htStatic/css/font-awesome-4.3.0.css" rel="stylesheet">
    <link href="htStatic/css/animate.css" rel="stylesheet">
    <link href="htStatic/css/style-2.2.0.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="layui/css/layui.css" />
    <link href="htStatic/css/index.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="layui/css/layui.css">
</head>

<body class="gray-bg">
    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div class="form-signin">
            <div id="stage">
                <div id="inner">
                    <div id="cover">
                        <div id="text">
                            <img src="assets/images/photos/head.png">
                            <div style="margin: -10%;user-select: none">
                                <span style="color: cyan;font-size: small">FPE</span><span style="color: white;font-size: small">在线投票系统</span>
                            </div>
                        </div>
                    </div>
                    <canvas class="mb-4" id="live2d" width="800" height="800"></canvas>
                </div>
            </div>
            <h3>欢迎登录  后台管理系统</h3>

            <form class="m-t">
                <div class="form-group">
                    <input name="loginName" type="text" class="form-control" placeholder="登录名" autocomplete="off" required="">
                </div>
                <div class="form-group">
                    <input name="password" type="password" class="form-control" placeholder="密码" autocomplete="off" required="">
                </div>
                <button type="button" id="loginBtn" class="btn btn-primary block full-width m-b">登 录</button>
                <p style="font-style:italic;">@author-E-Mail:  zhoubb@fpe.com.cn</p>
            </form>
        </div>
    </div>

    <!-- Mainly scripts -->
    <script src="htStatic/js/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="layui/layui.js"></script>
    <script src="htStatic/js/bootstrap.min-3.4.0.js"></script>
    <script src="htStatic/js/live2d.min.js"></script>
<script>
    $('#loginBtn').click(function(){
        var loginName = $('input[name=loginName]').val();
        var password = $('input[name=password]').val();
        if(loginName==""||password==""){
            layer.msg("请输入登录名或密码！")
        }else {
            $.ajax({
                url: '' + '/admin/login',
                method: 'POST',
                contentType: 'application/json',
                data: JSON.stringify({
                    userName: loginName,
                    passWord: password
                }),
                success: function(res) {
                    if (res.code != 200) {
                        layer.alert(res.msg);
                    } else {
                        sessionStorage.setItem('adminName',res.data.userName)
                        location.href = '/htAdmin';
                    }
                }
            })
        }
    })
</script>
</body>

</html>
